html,
body {
  height: 100%;
  background-color: #2c3e50;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
}
.container {
  width: 300px;
  height: 300px;
  position: relative;
}
.cycle {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
}
.white {
  background-color: #fff;
  z-index: 3;
  animation: shake 0.4s infinite;
}
.red {
  z-index: 2;
  background-color: red;
  animation: shake 0.3s infinite;
  animation-delay: 0.1s;
}
.green {
  z-index: 1;
  background-color: green;
  animation: shake 0.3s infinite;
  animation-delay: 0.2s;
}

@keyframes shake {
  0% {
    transform: translate(-3px, -6px);
  }
  25% {
    transform: translate(0px, 6px);
  }
  50% {
    transform: translate(3px, -6px);
  }
  75% {
    transform: translate(-4px, 2px);
  }
  100% {
    transform: translate(4px, 2px);
  }
}
